Optimal. Leaf size=267 \[ \frac {b \left (2 a^2 B (m+4)+3 a A b (m+3)-b^2 B (m+3)\right ) \tan ^{m+1}(c+d x)}{d (m+1) (m+3)}+\frac {\left (a^3 A-3 a^2 b B-3 a A b^2+b^3 B\right ) \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )}{d (m+1)}+\frac {\left (a^3 B+3 a^2 A b-3 a b^2 B-A b^3\right ) \tan ^{m+2}(c+d x) \, _2F_1\left (1,\frac {m+2}{2};\frac {m+4}{2};-\tan ^2(c+d x)\right )}{d (m+2)}+\frac {b^2 (a B (m+5)+A b (m+3)) \tan ^{m+2}(c+d x)}{d (m+2) (m+3)}+\frac {b B \tan ^{m+1}(c+d x) (a+b \tan (c+d x))^2}{d (m+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.69, antiderivative size = 267, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3607, 3637, 3630, 3538, 3476, 364} \[ \frac {\left (a^3 A-3 a^2 b B-3 a A b^2+b^3 B\right ) \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )}{d (m+1)}+\frac {\left (3 a^2 A b+a^3 B-3 a b^2 B-A b^3\right ) \tan ^{m+2}(c+d x) \, _2F_1\left (1,\frac {m+2}{2};\frac {m+4}{2};-\tan ^2(c+d x)\right )}{d (m+2)}+\frac {b \left (2 a^2 B (m+4)+3 a A b (m+3)-b^2 B (m+3)\right ) \tan ^{m+1}(c+d x)}{d (m+1) (m+3)}+\frac {b^2 (a B (m+5)+A b (m+3)) \tan ^{m+2}(c+d x)}{d (m+2) (m+3)}+\frac {b B \tan ^{m+1}(c+d x) (a+b \tan (c+d x))^2}{d (m+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 364
Rule 3476
Rule 3538
Rule 3607
Rule 3630
Rule 3637
Rubi steps
\begin {align*} \int \tan ^m(c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx &=\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))^2}{d (3+m)}+\frac {\int \tan ^m(c+d x) (a+b \tan (c+d x)) \left (-a (b B (1+m)-a A (3+m))+\left (2 a A b+a^2 B-b^2 B\right ) (3+m) \tan (c+d x)+b (A b (3+m)+a B (5+m)) \tan ^2(c+d x)\right ) \, dx}{3+m}\\ &=\frac {b^2 (A b (3+m)+a B (5+m)) \tan ^{2+m}(c+d x)}{d (2+m) (3+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))^2}{d (3+m)}-\frac {\int \tan ^m(c+d x) \left (a^2 (2+m) (b B (1+m)-a A (3+m))-\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) (2+m) (3+m) \tan (c+d x)-b (2+m) \left (3 a A b (3+m)-b^2 B (3+m)+2 a^2 B (4+m)\right ) \tan ^2(c+d x)\right ) \, dx}{6+5 m+m^2}\\ &=\frac {b \left (3 a A b (3+m)-b^2 B (3+m)+2 a^2 B (4+m)\right ) \tan ^{1+m}(c+d x)}{d (1+m) (3+m)}+\frac {b^2 (A b (3+m)+a B (5+m)) \tan ^{2+m}(c+d x)}{d (2+m) (3+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))^2}{d (3+m)}-\frac {\int \tan ^m(c+d x) \left (-\left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) (2+m) (3+m)-\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) (2+m) (3+m) \tan (c+d x)\right ) \, dx}{6+5 m+m^2}\\ &=\frac {b \left (3 a A b (3+m)-b^2 B (3+m)+2 a^2 B (4+m)\right ) \tan ^{1+m}(c+d x)}{d (1+m) (3+m)}+\frac {b^2 (A b (3+m)+a B (5+m)) \tan ^{2+m}(c+d x)}{d (2+m) (3+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))^2}{d (3+m)}+\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \int \tan ^{1+m}(c+d x) \, dx+\left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) \int \tan ^m(c+d x) \, dx\\ &=\frac {b \left (3 a A b (3+m)-b^2 B (3+m)+2 a^2 B (4+m)\right ) \tan ^{1+m}(c+d x)}{d (1+m) (3+m)}+\frac {b^2 (A b (3+m)+a B (5+m)) \tan ^{2+m}(c+d x)}{d (2+m) (3+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))^2}{d (3+m)}+\frac {\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \operatorname {Subst}\left (\int \frac {x^{1+m}}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac {\left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) \operatorname {Subst}\left (\int \frac {x^m}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {b \left (3 a A b (3+m)-b^2 B (3+m)+2 a^2 B (4+m)\right ) \tan ^{1+m}(c+d x)}{d (1+m) (3+m)}+\frac {\left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) \, _2F_1\left (1,\frac {1+m}{2};\frac {3+m}{2};-\tan ^2(c+d x)\right ) \tan ^{1+m}(c+d x)}{d (1+m)}+\frac {b^2 (A b (3+m)+a B (5+m)) \tan ^{2+m}(c+d x)}{d (2+m) (3+m)}+\frac {\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \, _2F_1\left (1,\frac {2+m}{2};\frac {4+m}{2};-\tan ^2(c+d x)\right ) \tan ^{2+m}(c+d x)}{d (2+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))^2}{d (3+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.72, size = 232, normalized size = 0.87 \[ \frac {\tan ^{m+1}(c+d x) \left (b (m+2) \left (2 a^2 B (m+4)+3 a A b (m+3)-b^2 B (m+3)\right )+(m+2) (m+3) \left (a^3 A-3 a^2 b B-3 a A b^2+b^3 B\right ) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )+(m+1) (m+3) \left (a^3 B+3 a^2 A b-3 a b^2 B-A b^3\right ) \tan (c+d x) \, _2F_1\left (1,\frac {m+2}{2};\frac {m+4}{2};-\tan ^2(c+d x)\right )+b^2 (m+1) \tan (c+d x) (a B (m+5)+A b (m+3))+b B (m+1) (m+2) (a+b \tan (c+d x))^2\right )}{d (m+1) (m+2) (m+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.73, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B b^{3} \tan \left (d x + c\right )^{4} + A a^{3} + {\left (3 \, B a b^{2} + A b^{3}\right )} \tan \left (d x + c\right )^{3} + 3 \, {\left (B a^{2} b + A a b^{2}\right )} \tan \left (d x + c\right )^{2} + {\left (B a^{3} + 3 \, A a^{2} b\right )} \tan \left (d x + c\right )\right )} \tan \left (d x + c\right )^{m}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{3} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.44, size = 0, normalized size = 0.00 \[ \int \left (\tan ^{m}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{3} \left (A +B \tan \left (d x +c \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{3} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\mathrm {tan}\left (c+d\,x\right )}^m\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^3 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \tan {\left (c + d x \right )}\right ) \left (a + b \tan {\left (c + d x \right )}\right )^{3} \tan ^{m}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________